#ifndef PROCESS_H
#define PROCESS_H
#include <QObject>
#include <iostream>
#include <QtSql>
#include <QtDebug>
#include "word.h"
#include "fileutil.h"

const QString SQL_CREATETABLE_VOCABULARY = "CREATE TABLE IF NOT EXISTS vocabulary(" \
    "id INTEGER PRIMARY KEY AUTOINCREMENT, " \
    "vocabulary_name VARCHAR(30), " \
    "size UNSIGNED INTEGER" \
    ") ";
const QString SQL_CREATETABLE_WORD = "CREATE TABLE IF NOT EXISTS word(" \
    "id INTEGER PRIMARY KEY AUTOINCREMENT, " \
    "original VARCHAR(50), " \
    "translation VARCHAR(50), " \
    "vocabulary_id INTEGER" \
    ")";
const QString SQL_CREATETABLE_USER = "CREATE TABLE IF NOT EXISTS user(" \
    "id INTEGER PRIMARY KEY AUTOINCREMENT, " \
    "current_vocabulary_id INTEGER, " \
    "group_size INTEGER " \
    ")";

const QString SQL_INSERT_VOCABULARY = "INSERT INTO vocabulary(vocabulary_name, size) VALUES(?, ?)";
const QString SQL_INSERT_WROD = "INSERT INTO word(original, translation, vocabulary_id) VALUES(?, ?, ?)";
const QString SQL_SELECT_VOCABULARY_ALL = "SELECT * FROM vocabulary ";
const QString SQL_SELECT_WORD_ALL = "SELECT * FROM word ";
const QString SQL_SELECT_USER_ALL = "SELECT * FROM user ";
class Process
{
public:
    static void init();
    static void clear();
    static void rush();
    static void config();
    static void initDb(const QList<Word>& words);
};


#endif // PROCESS_H
